package him.action.coursemanage.course;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import him.action.Action;
import him.action.ActionForward;
import him.dto.coursemanage.CourseDTO;
import him.service.CourseService;
import him.serviceimple.CourseServiceImple;

public class CourseDetailAction implements Action {

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) {
		ActionForward actforward = new ActionForward();
		CourseService service = CourseServiceImple.getInstance();
		CourseDTO dto = new CourseDTO();
		
		String course_code = request.getParameter("course_code");
		dto.setCourse_code(course_code);
		
		dto = service.getCourseDetail(dto);
		
		request.setAttribute("dto", dto);
		actforward.setUrl("coursedetail");
		
		return actforward;
	}

}
